package cloud.xiangyixiang.www.spring.boot.java.basics.annotations;

/**
 * <p>
 * SafeVarargsAnnotation
 * </p>
 *
 * @author weixin
 * @date 2023/9/7 15:16
 */
public class SafeVarargsAnnotation<S> {

    private S[] args;

    @SafeVarargs
    public SafeVarargsAnnotation(S... args){
        this.args = args;
    }

    @SafeVarargs
    public final void loopPrintArgs(S... args){
        for (S arg : args){
            System.out.println(arg);
        }
    }

    @SafeVarargs
    public final void printSelfArgs(S... args){
        for (S arg : this.args) {
            System.out.println(arg);
        }
    }

    @SafeVarargs
    public static <T> void loopPrintInfo(T... infos){
        for(T info:infos){
            System.out.println(info);
        }
    }

}
